<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<script>
	$(document).ready(
			function() {
				/* Set page style */
				$("#main").addClass("ui-widget");

				var delDisplayDialog = new ESLserverDialogObj(
						"#del-dialog-confirm", "#deladdScheduleButton",
						"/eslserver/DeleteScheduleAction.do");
				delDisplayDialog.buildDialog();
				delDisplayDialog.addDialogFunctions();

				/*Draw table*/
				var aoColumnDefs = [{"bSortable": false, "aTargets": [ 0 ]}];
				loadTemplate("#allScheduleList",
						"/eslserver/template/ScheduleTableTemplate.jsp",
						"#allSchedulerTemplate", "checkboxAll");
				loadTableData("#allScheduleList", "#allSchedulerTemplate",
						"/eslserver/LoadAllSchedules.do", "ScheduleInfo.jsp", "scheduleID",aoColumnDefs);

				$("#addSchedule").click(function() {
					window.location.replace("ScheduleInfo.jsp");
				});
				
				initFileUpload(2, 0);
			});
</script>

</head>
<body class="formBody">
	<form id="main">
		<div class="welcomeInfo">
			<table>
				<tr>
					<td><img id="sipixIcon" src="./images/sipix-logo.jpg"></img></td>
					<td>Welcome</td>
					<td class="message1"><c:out
							value="to Sipix ESL GUI Sever" />
					</td>
					<td>(</td>
					<td class="message1"><c:out value="Prototype V1.0" />
					</td>
					<td>)</td>
				</tr>
			</table>
		</div>
		<div style="clear: both;"></div>
		<fieldset id="eslMgmtFieldset" class="mainFieldSet">
			<legend class="mainLegend">Please use Schedule table below to
				configure ESL push schedules</legend>
			<fieldset class="subFieldSet">
				<legend class="subLegend">All Schedules</legend>
				<div>
					<img class="actionIcon" id="addSchedule" class="add"
						src="./images/add.png"></img>&nbsp;&nbsp; <img class="actionIcon"
						id="deladdScheduleButton" src="./images/del.png"></img>&nbsp;&nbsp;
				</div>
				<div id="allScheduleList"></div>
				<div>
					<c:choose>
						<c:when test="${!empty pushReturnMessage}">
							<div id="alert_dialog" class="ui-state-error ui-corner-all">
						</c:when>
						<c:otherwise>
							<div id="alert_dialog" class="ui-state-error ui-corner-all"
								style="display: none">
						</c:otherwise>
					</c:choose>
					<c:out value="${pushReturnMessage}" escapeXml="false" />
				</div>
			</fieldset>
		</fieldset>
	</form>
	<fieldset id="upload_zone">
		<legend class="mainLegend">Import Schedule(s)</legend>
		<form id="file_upload"
			action="/eslserver/ImportSchedule.do"
			method="POST" enctype="multipart/form-data" accept-charset="UTF-8">

			<div id="drop_zone_2" class="uploadBtn">
				<input type="file" id="file_2" name="Original">Choose File</input>
			</div>
			<table id="files_2" style="background: yellow;"></table>
			<br />
			<div>Please refresh the page manually after file upload</div>
		</form>
	</fieldset>
	<div id="del-dialog-confirm" title="Delete Schedules">
		<p>
			<span class="ui-icon ui-icon-alert"
				style="float: left; margin: 0 7px 20px 0;"></span>Do you really want
			to delete Schedule(s)?
		</p>
	</div>
</body>
</html>